/* Hybrid System Abstractor
 *
 * Copyright (c) 2013, Fortiss GmbH - An-Institut TU Muenchen
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.fortiss.automaton;

import javax.xml.bind.annotation.*;
import java.util.*;
import org.fortiss.util.*;



@XmlRootElement
public class KripkeStructure extends Automaton
{
    @XmlElement
    private Map<Integer, Predicate> id2pred;
    
    public KripkeStructure()    {}
    
    public void init(String name, List<Predicate> predicate)
    {
        id2pred = new HashMap<Integer, Predicate>(predicate.size());
        for (int i=0; i<predicate.size(); i++){
            id2pred.put(i, predicate.get(i));
        }
    }
        
    public Predicate getPredicate(int id)
    {
        return id2pred.get(id);
    }
    
    public Set<Predicate> toPredicate(Set<Integer> s)
    {
        Set<Predicate> ret = new HashSet<Predicate>(s.size());
        for (Integer i: s){
            ret.add(getPredicate(i));
        }
        return ret;
    }
}
